using System;
using System.Collections.Generic;
using System.Drawing;

class SurfaceLayout {
	private int maxWeight;
	private int width;
    private List<Point> points;
    private Boolean isSaved;

    private const int CIRCLE_DIAM = 7;
    private const int CIRCLE_RAD = CIRCLE_DIAM / 2;

	public SurfaceLayout() {
		this.points = new List<Point>();
        this.isSaved = false;
	}

	public void AddPoint(Point point) {
        this.points.Add(point);
	}

    public void Draw(Graphics g) {
        Pen p = new Pen(Color.Green, 2);
        SolidBrush b = new SolidBrush(Color.LightGreen);

        if(!this.isSaved) {
            p.Color = b.Color = Color.Red;
        }

        if(this.points.Count >= 2) {
            g.DrawLines(p, this.points.ToArray());
        }

        foreach(Point point in this.points) {
            g.FillEllipse(b, point.X - CIRCLE_RAD, point.Y - CIRCLE_RAD, CIRCLE_DIAM, CIRCLE_DIAM);
        }
    }
	
	public List<Point> Points {
		get { return this.points; }
	}
	
	public int MaxWeight {
		get { return this.maxWeight; }
		set { this.maxWeight = value; }
	}
	
	public int Width {
		get { return this.width; }
		set { this.width = value; }
	}

    public void Save() {
        this.isSaved = true;
    }
}